﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace EnvironmentalMonitor.WebApplication.Abstract
{
    /// <summary>
    /// 抽象保存Json数据页面类
    /// </summary>
    public abstract class AbstractSaveJson : EnvironmentalMonitor.WebApplication.Abstract.AbstractSecurityPage
    {
        private SaveJsonData _SaveJsonData;
        /// <summary>
        /// 保存Json数据
        /// </summary>
        public SaveJsonData SaveJsonData
        {
            get
            {
                return this._SaveJsonData;
            }
            set
            {
                this._SaveJsonData = value;
            }
        }

        /// <summary>
        /// Json数据
        /// </summary>
        /// <returns>Json数据</returns>
        public string Json()
        {
            string result = string.Empty;

            result = JsonConvert.SerializeObject(this.SaveJsonData);

            return result;
        }
    }
}